// 锚点跳转
const scrollToAnchor = (event) => {
    const href = event.target.getAttribute('href');
    window.location.hash = href;
// 可以将滚动位置定制为合适的位置
    const targetElement = document.querySelector(href);
    window.scrollTo({top: targetElement.offsetTop, behavior: "smooth"});
}

export default scrollToAnchor